home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act4 / 00060.ls < prev    next >
Encoding:
Text File  |  1995-04-05  |  3.2 KB  |  110 lines

  1. on exitFrame
  2.   global wrongcount, lastclickon, kingcolor, bucketcol, level1, masterlist, waittime, hintlist, BugColorKey, colornum, pal, cansounds
  3.   set gjidebug to 0
  4.   if level1 = 1 then
  5.     set offset to 0
  6.   else
  7.     set offset to 10
  8.   end if
  9.   set colornum to getAt(BugColorKey, lastclickon - 13)
  10.   set palnum to getAt(pal, colornum)
  11.   set correctcolor to getAt(colpal, palnum)
  12.   set rightcan to getPos(bucketcol, palnum)
  13.   set rightcolor to getAt(bucketcol, rightcan)
  14.   set mycolor to the foreColor of sprite lastclickon
  15.   startTimer()
  16.   set cansprite to rightcan + 37
  17.   set animlist to getAt(masterlist, offset + rightcolor)
  18.   repeat with xxx = 1 to 3
  19.     set the foreColor of sprite lastclickon to 0
  20.     updateStage()
  21.     set the foreColor of sprite lastclickon to mycolor
  22.     updateStage()
  23.     if the timer > 100 then
  24.       exit repeat
  25.     end if
  26.   end repeat
  27.   set mycast to the castNum of sprite cansprite
  28.   set myx to the locH of sprite cansprite
  29.   set myy to the locV of sprite cansprite
  30.   puppetSprite(cansprite, 1)
  31.   set limit to count(animlist)
  32.   startTimer()
  33.   set timelimit to the timer + 90
  34.   set numberoftimes to 0
  35.   set mysound to getAt(cansounds, rightcolor)
  36.   puppetSound(0)
  37.   puppetSound(mysound)
  38.   repeat while numberoftimes < 2
  39.     repeat with xxx = 1 to limit
  40.       set mymove to getAt(animlist, xxx)
  41.       set the castNum of sprite cansprite to getAt(mymove, 1)
  42.       set the locH of sprite cansprite to getAt(mymove, 2) + myx
  43.       set the locV of sprite cansprite to getAt(mymove, 3) + myy
  44.       updateStage()
  45.       set slowdown to the timer + waittime
  46.       repeat while the timer < slowdown
  47.       end repeat
  48.       if not (the soundBusy of 1) then
  49.         puppetSound(mysound)
  50.       end if
  51.     end repeat
  52.     set numberoftimes to numberoftimes + 1
  53.   end repeat
  54.   puppetSound(0)
  55.   if not gjidebug then
  56.     setcolor(lastclickon, 0)
  57.   end if
  58.   set the castNum of sprite cansprite to mycast
  59.   set the locH of sprite cansprite to myx
  60.   set the locV of sprite cansprite to myy
  61.   updateStage()
  62.   if level1 = 1 then
  63.     set hinter to 1
  64.   else
  65.     set hinter to 2
  66.   end if
  67.   if wrongcount = 1 then
  68.     if hintlist = [] then
  69.       set hintlist to [1, 2, 3]
  70.     end if
  71.     set randpos to random(count(hintlist))
  72.     set myhint to getAt(hintlist, randpos)
  73.     deleteAt(hintlist, randpos)
  74.     if level1 = 1 then
  75.       repeat with xxxx = 38 to 41
  76.         if not (cansprite = xxxx) then
  77.           puppetSprite(xxxx + 4, 1)
  78.           next repeat
  79.         end if
  80.         puppetSprite(xxxx + 4, 0)
  81.         set the visible of sprite (xxxx + 4) to 1
  82.       end repeat
  83.       play frame "L" & hinter & ".Hint1." & myhint
  84.       repeat with xxxx = 42 to 45
  85.         puppetSprite(xxxx, 0)
  86.       end repeat
  87.     else
  88.       play frame "L" & hinter & ".Hint1." & myhint
  89.     end if
  90.   else
  91.     if level1 = 1 then
  92.       repeat with xxxx = 38 to 41
  93.         if not (cansprite = xxxx) then
  94.           puppetSprite(xxxx + 4, 1)
  95.           next repeat
  96.         end if
  97.         puppetSprite(xxxx + 4, 0)
  98.         set the visible of sprite (xxxx + 4) to 1
  99.       end repeat
  100.       play frame "L" & hinter & ".Hint2." & rightcolor
  101.       repeat with xxxx = 42 to 45
  102.         puppetSprite(xxxx, 0)
  103.       end repeat
  104.     else
  105.       play frame "L" & hinter & ".Hint2." & rightcolor
  106.     end if
  107.   end if
  108.   play done
  109. end
  110.